// cec 接口函数
import global from "@/utils/global.params.js";
import axios from "@/axios/config/axios.js";

const cec = {
    // 自选-请求
    favorites() {
        return new Promise((resolve, reject) => {
            axios.post("/cec/favorites").then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
        })
    },
    //行情列表-请求
    marketList(param) {
        return new Promise((resolve, reject) => {
            axios.post("/cec/marketlist", { data: param }).then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
        })
    },

    // cec-指数-请求
    exponent(param) {
        return new Promise((resolve, reject) => {
            axios.post("/cec/exponent", param).then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
        })
    },

    // k-charts-请求
    kChartsData(param) {
        return new Promise((resolve, reject) => {
            axios.post("/cec/kline", { data: param }).then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
        })
    },
}

export default cec